Computer graphics systems are commonly used for displaying graphical representations of objects on a two-dimensional video display screen. Current computer graphics systems provide highly detailed representations and are used in a variety of applications.
In typical computer graphics systems, an object to be represented on the display screen is broken down into graphics primitives. Primitives are basic components of a graphics display and may include points, lines, vectors and polygons, such as triangles and quadrilaterals. Typically, a hardware/software scheme is implemented to render or draw the graphics primitives that represent a view of one or more objects being represented on the display screen.
The primitives of the three-dimensional object to be rendered are defined by a host computer in terms of primitive data. For example, when the primitive is a triangle, the host computer may define the primitive in terms of the X, Y and Z coordinates of its vertices, as well as the red, green and blue (R, G and B) color values of each vertex. Additional primitive data may be used in specific applications. Rendering hardware interpolates the primitive data to compute the display screen pixels that represent each primitive, and the R, G and B color values for each pixel.
The basic components of a computer graphics system may include a geometry engine, or geometry accelerator, a rasterizer and a frame buffer. The system may also include texture mapping hardware. The geometry accelerator receives from the host computer primitive data which defines the primitives that make up the view to be displayed. The geometry accelerator performs transformations on the primitive data, decomposes quadrilaterals into triangles, and performs lighting, clipping and plane equation calculations for each primitive. The output of the geometry accelerator is rendering data used by the rasterizer and the texture mapping hardware to generate final coordinate and color data for each pixel in each primitive. The pixel data from the rasterizer and the pixel data from the texture mapping hardware, if available, are combined and stored in the frame buffer for display on the video display screen.
The operations of the geometry accelerator are highly computation intensive. One frame of a 3-D graphics display may include on the order of hundreds of thousands of primitives. To achieve state of the art performance, the geometry accelerator may be required to perform on the order of several hundred million floating point calculations per second per chip. Furthermore, the volume of data transferred between the host computer and the graphics hardware is very large. The data for a single quadrilateral may be on the order of 64 words of 32 bits each. Additional data transmitted from the host computer to the geometry accelerator includes lighting parameters, clipping parameters and any other parameters needed to generate the graphics display.
Various techniques have been employed to improve the performance of geometry accelerators, including pipelining and multiprocessing. Nonetheless, the need exists for additional improvements in performance.
The red, green and blue color values are determined for each vertex by summing the ambient color and the diffuse and specular color contribution for each of the active light sources in the scene. A scene may have several light sources of different types. For spotlights, the intensity is a function of the angle between two vectors, a vector direction which defines the direction from which the spotlight is pointing and a vector direction from the vertex to the position of the spotlight. The intensity pattern of the spotlight, the variation of intensity as a function of angle, is typically specified by raising the cosine of the angle to an integer power. A larger integer power indicates a narrower pattern. Specular lighting calculations involve raising the cosine of the angle between two vectors to an integer power. Those vectors are the light reflection direction from the vertex and the direction from the vertex to the position of the eye. The integer power defines the degree of specularity. In each case, the cosine of the angle is represented by a floating point number. Typically, multiple processor cycles are required to determine an integer power of a floating point number. Since, as noted above, one frame of a 3-D graphics display may include on the order of hundreds of thousands of primitives, it is important to perform this calculation as efficiently and quickly as possible.
In prior art graphics systems, the lighting calculations which required determining an integer power of a floating point number were performed in software in the host computer. This approach was relatively inefficient and occupied resources of the host computer which could not therefore be utilized for other tasks.